// ProgramLocation.cpp

#include "StdAfx.h"

#include "Common/MyFixes.h" //dummy char

#include "ProgramLocation.h"

#include "Common/System/DLL.h"


namespace Common
{
namespace App
{
using namespace Common::System;

bool GetProgramFolderPath(CString &folder)
{
  if (!DLL::GetModuleFileName(_AtlBaseModule.GetModuleInstance(), folder))
    return false;
  int pos = folder.ReverseFind(CHAR_PATH_SEPARATOR);
  if (pos < 0)
    return false;
  folder = folder.Left(pos + 1);
  return true;
}

}
}